<?php

require_once(BaseConfig::LoadClass('/contrib/php_mailer/class.phpmailer.php'));

class MailSystem {
  var $__Mailer;
  
  function MailSystem() {
    $this->__Mailer = new PHPMailer();
    
/*
    $this->__Mailer->IsSMTP(); // telling the class to use SMTP
    $this->__Mailer->SMTPSecure    = "ssl";
    $this->__Mailer->Mailer        = "smtp";
    $this->__Mailer->Host          = "blossom.ihostmarket.net";
    $this->__Mailer->SMTPAuth      = true;                  // enable SMTP authentication
    $this->__Mailer->SMTPKeepAlive = false;                 // SMTP connection will not close after each email sent
    $this->__Mailer->Port          = 465;                    // set the SMTP port for the GMAIL server
    $this->__Mailer->Username      = "bffhb@bff.com.mx";    // SMTP account username
    $this->__Mailer->Password      = "bffhb";               // SMTP account password
//    $this->__Mailer->FromName      = "Alertas BFF HB";
    
    $this->__Mailer->Sender        = 'bffhb@bff.com.mx';
    $this->__Mailer->AddReplyTo('bffhb@bff.com.mx', 'bffhb@bff.com.mx');
// */
//*
    $this->__Mailer->IsSMTP(); // telling the class to use SMTP
    $this->__Mailer->Host          = "bff.com.mx";
    $this->__Mailer->SMTPAuth      = true;                  // enable SMTP authentication
    $this->__Mailer->SMTPKeepAlive = false;                 // SMTP connection will not close after each email sent
    $this->__Mailer->Port          = 26;                    // set the SMTP port for the GMAIL server
    $this->__Mailer->Username      = "bffhb@bff.com.mx";    // SMTP account username
    $this->__Mailer->Password      = "bffhb";               // SMTP account password
    
    $this->__Mailer->Sender        = 'bffhb@bff.com.mx';
    $this->__Mailer->AddReplyTo('bffhb@bff.com.mx', 'bffhb@bff.com.mx');
// */
/*
    $this->__Mailer->IsSMTP(); // telling the class to use SMTP
    $this->__Mailer->Host          = "geainternacional.com";
    $this->__Mailer->SMTPAuth      = true;                  // enable SMTP authentication
    $this->__Mailer->SMTPKeepAlive = false;                  // SMTP connection will not close after each email sent
    $this->__Mailer->Port          = 26;                    // set the SMTP port for the GMAIL server
    $this->__Mailer->Username      = "siga_alertas@geainternacional.com"; // SMTP account username
    $this->__Mailer->Password      = "siga_alertas";        // SMTP account password
    
    $this->__Mailer->Sender        = 'siga_alertas@geainternacional.com';
    $this->__Mailer->AddReplyTo('siga_alertas@geainternacional.com', 'siga_alertas@geainternacional.com');
// */
    $this->__Mailer->Subject       = "PHPMailer Test Subject via smtp, basic with authentication";
  }
  
  function Titulo($strTitulo = "") {
    if($strTitulo) {
      $this->__Mailer->Subject = $strTitulo;
    }
    
    return $this->__Mailer->Subject;
  }
  
  function Mensaje($strMensaje) {
    $this->__Mailer->MsgHTML($strMensaje);
  }
  
  function AddAdress($strCorreo, $strNombre = "") {
    if($strNombre == "") {
      $strNombre = $strCorreo;
    }
    
    $this->__Mailer->AddAddress($strCorreo, $strNombre);
  }
  
  function Send() {
    $bolExito = $this->__Mailer->Send();
    if(!$bolExito) {
      die("Fracaso al tratar de enviar correo");
    }
  }
}

?>